/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.servinf.ani.sincronizador.entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author mortiz
 */
@Entity
@Table(catalog = "ani_admin", schema = "public")
@NamedQueries({
    @NamedQuery(name = "Concesionaria.findAll", query = "SELECT c FROM Concesionaria c")})
public class Concesionaria implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id_concesionario")
    private Integer idConcesionario;
    @Column(name = "nombre_concesionario")
    private String nombreConcesionario;
    @OneToMany(mappedBy = "concesionaria")
    private List<Concesion> concesionList;

    public Concesionaria() {
    }

    public Concesionaria(Integer idConcesionario) {
        this.idConcesionario = idConcesionario;
    }

    public Integer getIdConcesionario() {
        return idConcesionario;
    }

    public void setIdConcesionario(Integer idConcesionario) {
        this.idConcesionario = idConcesionario;
    }

    public String getNombreConcesionario() {
        return nombreConcesionario;
    }

    public void setNombreConcesionario(String nombreConcesionario) {
        this.nombreConcesionario = nombreConcesionario;
    }

    public List<Concesion> getConcesionList() {
        return concesionList;
    }

    public void setConcesionList(List<Concesion> concesionList) {
        this.concesionList = concesionList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idConcesionario != null ? idConcesionario.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Concesionaria)) {
            return false;
        }
        Concesionaria other = (Concesionaria) object;
        if ((this.idConcesionario == null && other.idConcesionario != null) || (this.idConcesionario != null && !this.idConcesionario.equals(other.idConcesionario))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.servinf.ani.sincronizador.entities.Concesionaria[ idConcesionario=" + idConcesionario + " ]";
    }
    
}
